<template>
  <div>
    <h1>我是子组件</h1>{{ msg[0] }}
    <button @click="toFather">给父组件传值</button>
  </div>
</template>
<script>
export default {
  props: {
    msg: Array
  },
  data() {
    return {
      msgChild: '我是子组件的值',
    }
  },

  methods: {
    toFather() {
      this.$emit('msgChild', this.msgChild);
    }
  }
}
</script>